import service from "@/utils/request.ts";
import {COMPLETE_PRE} from '@/api/port-info.ts'

/**
 * 获取菜单信息列表
 * @param params 参数
 */
export async function getMenuTreeListReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/menu/getList',
        method: 'POST',
        data: params
    });
}

/**
 * 保存菜单信息
 * @param params 参数
 */
export async function saveMenuReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/menu/saveItem',
        method: 'POST',
        data: params
    });
}

/**
 * 删除菜单信息
 * @param params 参数
 */
export async function delMenuReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/menu/deleteItem',
        method: 'POST',
        data: params
    });
}

/**
 * 获取父级菜单信息
 * @param params 参数
 */
export async function getParentMenuDropDownReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/menu/getParentMenusDropDown',
        method: 'POST',
        data: params
    });
}

/**
 * 获取父级菜单信息
 * @param params 参数
 */
export async function getAllPageDropDownReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/menu/getAllPageDropDown',
        method: 'POST',
        data: params
    });
}

/**
 * 保存菜单角色信息信息
 * @param params 参数
 */
export async function saveMenuRoleIdsReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/menu/saveRoleByMenuId',
        method: 'POST',
        data: params
    });
}

/**
 * 保存菜单角色信息信息
 * @param params 参数
 */
export async function getMenuRoleIdsReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/menu/getMenuRoleIds',
        method: 'POST',
        data: params
    });
}